import request from '@/utils/request_miva_work.js';

// 获取项目列表
export function getProjectList({ project_type, page, size } = {}) {
  return request({
    url: '/project',
    method: 'GET',
    params: { project_type, page, size }
  });
}
// 获取项目详情
export function getProjectDetail(id) {
  return request({
    url: '/project',
    method: 'GET'
  });
}
// 添加项目
export function addProject({ title, cover, description, content, project_type } = {}) {
  return request({
    url: '/addProject',
    method: 'POST',
    data: { title, cover, description, content, project_type }
  });
}
// 删除项目
export function deleteProject(id) {
  return request({
    url: '/deleteProject/' + id,
    method: 'DELETE'
  });
}
// 修改项目
export function updateProject(id, { title, cover, description, content, project_type } = {}) {
  return request({
    url: '/updateProject/' + id,
    method: 'PUT',
    data: { title, cover, description, content, project_type }
  });
}
